{% extends "myadmin/base.html" %}

{% block mainbody %}                
    <h4>
        会员信息管理
    </h4>
    <form id="edit-profile" action="{% url 'myadmin_users_index' 1 %}" class="form-horizontal" method="get">
            <div class="control-group">
                <label class="control-label" for="input01">关键字：</label>
                <div class="controls">
                    <input type="text" name="username" class="input-xlarge" id="input01" value="{{request.GET.username}}" placeholder="账号/真实姓名" />
                    
                    <button type="submit" class="btn btn-primary">查询</button> <button type="reset" class="btn">重置</button>
                </div>
            </div>
    </form>
    <table class="table table-bordered table-striped">
        <thead>
            <tr>
                <th>账号</th>
                <th>真实姓名</th>
                <th>性别</th>
                <th>邮箱</th>
                <th>注册时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for vo in userslist %}
            <tr>
                <td>{{ vo.username }}</td>
                <td>{{ vo.name }}</td>
                <td>{% if vo.sex == 1 %}男{% else %}女{% endif %}</td>
                <td>{{ vo.email }}</td>
                <td>{{ vo.addtime|date:'Y-m-d H:i:s' }}</td>
                <td>{% if vo.state == 1 %}启用{% elif vo.state == 2 %}禁用{% elif vo.state == 0 %}后台管理{% endif %}</td>
                <td>
                    <a href="{% url 'myadmin_users_del' vo.id %}" class="view-link">删除</a>
                    <a href="{% url 'myadmin_users_edit' vo.id %}" class="view-link">编辑</a>
                    <a href="{% url 'myadmin_users_password' vo.id %}" class="view-link">重置密码</a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>                
    <div class="pagination">
        <ul>
            <!--<li class="disabled">
                <a href="#">&laquo;</a>
            </li>-->
            {% for i in plist %}
            <li {% if pIndex == i %}class="active"{% endif %}>
            <a href = "{% url 'myadmin_users_index' i %}?{{ mywhere|join:'&' }}">{{i}}</a>
            </li>
            {% endfor %}
            <!--
            <li class="active">
                <a href="#">1</a>
            </li>
            <li>
                <a href="#">2</a>
            </li>
            <li>
                <a href="#">3</a>
            </li>
            <li>
                <a href="#">4</a>
            </li> 
            <li>
                <a href="#">&raquo;</a>
            </li>-->
        </ul>
    </div>
{% endblock %}
